package service;


import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author: hett
 * @date: 2022/3/14 11:11
 */
public class FakeIOService {
    private static int port = 3210;

    private static Socket socket;

    public static void main(String[] args){
        try {
            ServerSocket serverSocket = new ServerSocket(port);
            ExecutorService executorService = Executors.newFixedThreadPool(60);
            while (true){
                socket = serverSocket.accept();
                FakeHandleThread thread = new FakeHandleThread();
                thread.setSocket(socket);
                executorService.execute(thread);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
